<template>
  <div class="productvideo">
    <div class="header">
        <div class="image">
            <img src="../../../../static/img/logo_1.png" alt="">
        </div>
        <h2>功能视频展示</h2>
        <div class="image-1">
            <router-link to="/ProductsVideo">
                <img src="../../../../static/img/right.png" alt="">
            </router-link>
        </div>
    </div>
    <div class="videolist">
        <ul>
            <li v-for="(videoLists, index) in videoList" :key="index">
                <div>
                    <router-link :to="{name:'VideoPage',params:{id:videoLists.id}}">
                        <img :src="videoLists.cover" alt="" class="image-1">
                    </router-link>
                    <router-link :to="{name:'VideoPage',params:{id:videoLists.id}}"><img src="../../../../static/img/btn-bofang.png" alt="" class="image-2">
                    </router-link>
                </div>
                <H3>
                    <router-link :to="{name:'VideoPage',params:{id:videoLists.id}}">{{videoLists.title}}</router-link>
                </H3>
            </li>
        </ul>
    </div>
    <span></span>
  </div>
</template>
<script>
export default {
  name: 'ProductVideo',
  data(){
     return {
        videoList:[]
     }
  },
  created(){
      this.axios.get('/articles/home',{
          params: {
              category: 3,
              limit: 4
          }
      })
      .then((res) => {
          this.videoList = res.data.data;
          this.videoList.unshift(res.data.meta.first);
      })
      .catch((error) => {
          console.log(error);
      })
  }
}
</script>
<style scoped>
.productvideo{
    width: 100%;
    height: auto;
    margin-top: .47rem;
}
.productvideo .header{
    width: 100%;
    height: .53rem;
    line-height: .53rem;
}
.productvideo .header .image{
    width: .53rem;
    height: .53rem;
    float: left;
    margin-left: .2rem;
}
.productvideo .header .image img{
    width: 100%;
    height: auto;
}
.productvideo .header h2{
    font-size: .3rem;
    color: #1d2977;
    float: left;
    font-weight: bold;
}
.productvideo .header .image-1{
    float: right;
    width: .32rem;
    height: .32rem;
    margin-right: .2rem;
    margin-top: .1rem;
}
.productvideo .header .image-1 img{
    width: 100%;
    height: auto;
}
.productvideo .videolist{
    width: 100%;
    height: auto;
    margin-top: .3rem;
}
.productvideo .videolist ul li{
    width: 3.17rem;
    height: 2.24rem;
    margin-left: .4rem;
    display: inline-block;
    text-align: center;
    margin-top: .6rem;
}
.productvideo .videolist ul li:nth-child(1),.productvideo .videolist ul li:nth-child(2){
    margin-top: 0;
}
.productvideo .videolist ul li h3{
    width: 100%;
    height: .4rem;
    color: #333;
    font-size: 14px;
    margin-top: .15rem;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
}
.productvideo .videolist ul li h3 a{
    display: inline-block;
    height: .7rem;
}
.productvideo .videolist ul li div{
    width: 3.17rem;
    height: 1.83rem;
    position: relative;
}
.productvideo .videolist ul li div .image-1{
    width: 100%;
    height: auto;
}
.productvideo .videolist ul li div .image-2{
    width: .6rem;
    height: .6rem;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left:0;
    margin: auto;
}
.productvideo span{
    width: 100%;
    height: 0;
    display: inline-block;
    border-top: .2rem  solid #e8e8e8;
    margin-top: .4rem;
}
@media screen and (max-width: 320px) {
    .productvideo .videolist ul li h3{
    width: 100%;
    height: .46rem;
    color: #333;
    font-size: 14px;
    margin-top: .15rem;
    overflow: hidden;
}
.productvideo .videolist ul li h3 a{
    display: inline-block;
    height: .75rem;
}
}    
</style>
